﻿using Cart.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cart.DAL
{
    public class UserDAl
    {
        Entity en = new Entity();
        public IQueryable<Users> user()
        {
            return en.Users;
        }
        public void det(int uid) 
        {
            var ob = en.Users.Where(a=>a.userID==uid).FirstOrDefault();
            en.Users.Remove(ob);
        }

        public void detall(int []uids)
        {
            var ob = en.Users.Where(a=>uids.Contains(a.userID)).ToList();
            en.Users.RemoveRange(ob);
        }
        public int save() 
        {
          return  en.SaveChanges(); 
        }


        //添加操作  
        public void AddUser(Users us)
        {
            en.Users.Add(us);
        }
    }
   
}
